class Solution {
 public:
  bool hasSpecialSubstring(string s, int k) {
    int count = 1;

    for (int i = 1; i < s.length(); ++i) {
      if (s[i] == s[i - 1])
        ++count;
      else if (count == k)
        return true;
      else
        count = 1;
    }

    return count == k;
  }
};
